﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage2.master" AutoEventWireup="true" CodeFile="XemThongTinDatHang.aspx.cs" Inherits="XemThongTinDatHang" %>

<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">

                        <p>
                            &nbsp;</p>
    <p>
        <asp:GridView ID="GridView_HoaDon" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" 
            DataSourceID="SqlDataSource_HoaDon" 
            onselectedindexchanged="GridView_HoaDon_SelectedIndexChanged">
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="Mã HĐ" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" />
                <asp:BoundField DataField="ThanhVienMuaHang" HeaderText="Khách Hàng" 
                    SortExpression="ThanhVienMuaHang" />
                <asp:BoundField DataField="MaGianHang" HeaderText="Gian Hàng" 
                    SortExpression="MaGianHang" />
                <asp:BoundField DataField="TinhTrangHoaDon" HeaderText="Tình Trạng" 
                    SortExpression="TinhTrangHoaDon" />
                <asp:BoundField DataField="TongSoTienThanhToan" HeaderText="Số Tiền Thanh Toán" 
                    SortExpression="TongSoTienThanhToan" />
                <asp:BoundField DataField="ThoiGianChuyenHang" 
                    HeaderText="Thời Gian Chuyển Hàng" SortExpression="ThoiGianChuyenHang" />
                <asp:BoundField DataField="ThoiGianThanhToan" HeaderText="Thời Gian Thanh Toán" 
                    SortExpression="ThoiGianThanhToan" />
                <asp:BoundField DataField="ThoiGianLapHoatDon" 
                    HeaderText="Thời Gian Lập Hóa Đơn" SortExpression="ThoiGianLapHoatDon" />
            </Columns>
        </asp:GridView>
        <br />
        <asp:SqlDataSource ID="SqlDataSource_HoaDon" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            DeleteCommand="DELETE FROM [HOA_DON] WHERE [ID] = @ID" 
            InsertCommand="INSERT INTO [HOA_DON] ([ThanhVienMuaHang], [MaGianHang], [TinhTrangHoaDon], [TongSoTienThanhToan], [ThoiGianChuyenHang], [ThoiGianThanhToan], [ThoiGianLapHoatDon]) VALUES (@ThanhVienMuaHang, @MaGianHang, @TinhTrangHoaDon, @TongSoTienThanhToan, @ThoiGianChuyenHang, @ThoiGianThanhToan, @ThoiGianLapHoatDon)" 
            SelectCommand="SELECT * FROM [HOA_DON]" 
            UpdateCommand="UPDATE [HOA_DON] SET [ThanhVienMuaHang] = @ThanhVienMuaHang, [MaGianHang] = @MaGianHang, [TinhTrangHoaDon] = @TinhTrangHoaDon, [TongSoTienThanhToan] = @TongSoTienThanhToan, [ThoiGianChuyenHang] = @ThoiGianChuyenHang, [ThoiGianThanhToan] = @ThoiGianThanhToan, [ThoiGianLapHoatDon] = @ThoiGianLapHoatDon WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="ThanhVienMuaHang" Type="Int32" />
                <asp:Parameter Name="MaGianHang" Type="Int32" />
                <asp:Parameter Name="TinhTrangHoaDon" Type="Int32" />
                <asp:Parameter Name="TongSoTienThanhToan" Type="Int64" />
                <asp:Parameter Name="ThoiGianChuyenHang" Type="DateTime" />
                <asp:Parameter Name="ThoiGianThanhToan" Type="DateTime" />
                <asp:Parameter Name="ThoiGianLapHoatDon" Type="DateTime" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ThanhVienMuaHang" Type="Int32" />
                <asp:Parameter Name="MaGianHang" Type="Int32" />
                <asp:Parameter Name="TinhTrangHoaDon" Type="Int32" />
                <asp:Parameter Name="TongSoTienThanhToan" Type="Int64" />
                <asp:Parameter Name="ThoiGianChuyenHang" Type="DateTime" />
                <asp:Parameter Name="ThoiGianThanhToan" Type="DateTime" />
                <asp:Parameter Name="ThoiGianLapHoatDon" Type="DateTime" />
            </InsertParameters>
        </asp:SqlDataSource>
    </p>
    <p>
    </p>
    <p>
    </p>

</asp:Content>
